Supporting simple and complex cases in Response mapping

Response data can be simple json object or have sub-objects returned in a json array. In this section, you will see how response fields will be mapped to Platform fields.

Simple case: For example, if you map REST response fields to Platform Base object fields, the REST response field is mapped from simple Json object, there is a direct 1 to 1 correlation between the REST service data and the Platform Object data.

When the REST response field is mapped to an array of Json object fields, then the first entry is picked from the array of objects and is mapped to Platform Base object.

Complex case: The three available options when you map REST response containing sub-objects to Platform Related objects are:

  • Add sub-objects as new record: Enables you to add a new record and attach it to the base object
  • Update an existing record: Enables you to map the fields that are used to uniquely identify the related record in Platform existing records.
    Note: You can map more than one field that can be compared against REST response. The fields will be updated only if matched. If multiple mapping is done, all conditions should match to update a record (that is, an AND condition).
  • Update if existing else Add as new: Enables you to update an existing record option. However, if the condition does not match, it will create a new record in Platform related object and attach it to the base object.
Note: When you add REST response sub-object fields to Platform related object fields, these options pop-up while mapping the first sub-object field.

The table below explains the supported levels in response mapping.

Supported levels in response mapping
Platform object REST Response Type Platform Relationship REST Response action Operation Supported
Base Object Object - - Update Yes
Base Object Array - Updates from first array item Update Yes
Related Object Object 1:1 Uses this object for operation Create,Update, or UpdateElseCreate Yes
Related Object Array 1:1 Picks first item from array and uses it for operation Create,Update, or UpdateElseCreate Yes
Related Object Object 1:M or M:M Uses this object for operation Create,Update, or UpdateElseCreate Yes
Related Object Array 1:M or M:M Uses all objects for operation Create,Update, or UpdateElseCreate Yes

You can't map REST response fields from a different level or a same level (from different object) to a single Platform related object. However, you can create another Related object and map fields from different REST response object.